/**
 * 输入模态框服务
 * Created by zhaijg.
 */
'use strict';
angular.module('app')
    .factory('inputModalServices', ['$modal', function ($modal) {
        return {
            showInput: function (title,info) {
                var modalInstance = $modal.open({
                    templateUrl: 'tpl/modal/inputModal.html',
                    controller: 'inputMessageCtrl',
                    size: 'sm',
                    resolve: {
                        title: function () {
                            return title;
                        },
                        info: function () {
                            return info;
                        }
                    }
                });
                //操作返回
                return modalInstance.result;
            }
        };
    }]);
/**
 * 输入框控制器
 * Created by zhaijg.
 */
'use strict';
app.controller('inputMessageCtrl', ['$scope', '$modalInstance', 'title', 'info',
    function ($scope, $modalInstance, title, info) {
        $scope.message_title = title;
        $scope.message_info = info;
        //点确认按钮关闭
        $scope.ok = function () {
            $modalInstance.close($scope.message_info);
        };
        //取消按钮
        $scope.cancel = function () {
            $modalInstance.dismiss('cancel');
        };
    }]);